{extends file="./main.tpl"}
{block name=head}

<style type="text/css" title="currentStyle">
  @import "./media/css/demo_page.css";
  @import "./media/css/demo_table_jui.css";
  @import "./media/css/jquery-ui-1.8.4.custom.css";
</style>
<script type="text/javascript" language="javascript" src="./media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="./media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() 
  {
	  oTable = $('#example').dataTable(
	  {
		  "bJQueryUI": true,
		  "sPaginationType": "full_numbers",
		  "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
	  });
  });
</script>

<script type="text/javascript">
$(document).ready(function() {
	$(".add").blur(function()
	{
	  if($(".add:last").val() != '' && $(".add:last").val() > 0)
	  {
      $("#one").clone(true).appendTo("#mainDiv")
      .find('input[type="text"]').val('').end()
      .find('select[option=""]').val('');
    }
  });
});
function myFunction()
{
  if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{/block}
{block name=body}
<form name="party" action="{$smarty.server.PHP_SELF}" method="post" onsubmit="return confirm('DO You Want To Submit !!!!!')";>
<table align="center" border="2" cellpadding="2" cellspacing="2" width="" >
<tr>
  <td align="center" class="table1" colspan="6"><b>Party Master</b></td>
</tr>
<tr>
  <td class="table2" colspan="2" align="center">Name :<input type="text" name="name" required autofocus /></td>
  <td class="table2" colspan="3" align="center">Firm Name :<input type="text" name="firmName"  /></td>
</tr>
<tr>
	<td class="table2" align="center" colspan="2">Address :<textarea  name="address"  /></textarea></td>
  <td class="table2" align="center" colspan="2">Telephone :<input type="text" name="telNo" /></td>
  <td class="table2" align="center" colspan="2">Mobile :<input type="text" name="mobileNo" /></td>
</tr>
<tr>
	<td class="table2" align="center" colspan="2">Route</td>
	<td class="table2" align="center">Item </td>
	<td class="table2" align="center">Rate w/o</td>
	<td class="table2" align="left" colspan="2">Rate With Bill</td>
</tr>
<tbody id="mainDiv">
<tr id="one">
  <td align="center" class="table2">
  	FROM
  		<select name="fromId[]">
        {html_options values=$branchArray.branchId output=$branchArray.branchName}
      </select>
  </td>
  <td align="center" class="table2">
  	TO
  		<select name="toId[]">
        {html_options values=$branchArray.branchId output=$branchArray.branchName}
      </select>
  </td>
  <td align="center" class="table2"><input type="text" name="item[]" class="add">
  </td>
  <td align="center" class="table2"><input type="text" name="rate[]">
  </td>
  <td align="left" class="table2" colspan="2"><input type="text" name="rateWithBill[]"/>
  </td>
</tr>
</tbody>
	<tr>
  <td colspan="5" align="center" class="table2">
  	Remarks : <textarea name="remarks" h></textarea>
  </td>
</tr>
	<td colspan="6" align="center" class="table1"><input type="submit" value="Submit" name="submit" class="button"></td>
</tr>
</table>
<br /><br />
<body id="dt_example">
		<div id="container">
	  <div class="demo_jui">
		  <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
			  <thead>
				  <tr>
					  <th NOWRAP><b>&nbsp;</b></th>
					  <th NOWRAP><b>&nbsp;</b></th>
						<th NOWRAP><b>Name</b></th>
						<th NOWRAP><b>Firm Name</b></th>
						<th NOWRAP><b>Address</b></th>
						<th NOWRAP><b>Telephone</b></th>
						<th NOWRAP><b>Mobile No</b></th>
						<th NOWRAP><b>Remarks</b></th>
					</tr>
				</thead>
				<tbody>
				  {section name="sec" loop=$partyArray}
						<tr>
						  <td align="center"><a href="partyDetail.php?partyId={$partyArray[sec].partyId}" class="link" style="color:red;">Detail</a></td>      
						  <td align="center"><a href="partyDelete.php?partyId={$partyArray[sec].partyId}" onclick="return myFunction();" class="link"> <img src="./images/deleteIco.png"></a></td>
						  <td align="center">{$partyArray[sec].name}</td>
						  <td align="center">{$partyArray[sec].firmName}</td>
						  <td align="center">{$partyArray[sec].address}</td>
						  <td align="center">{$partyArray[sec].telNo}</td>
						  <td align="center">{$partyArray[sec].mobileNo}</td>
						  <td align="center">{$partyArray[sec].remarks}</td>
						</tr>
					{/section}
				</tbody>
			</table>
		</div>
		<div class="spacer"></div>
		</div>
</body>
</form>
{/block}